package com.aidex.biz.service.impl;

import com.aidex.biz.domain.OrderImage;
import com.aidex.biz.mapper.OrderImageMapper;
import com.aidex.biz.service.OrderImageService;
import com.aidex.common.annotation.DataScope;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.common.utils.NumberUtils;
import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 订单详情照片Service业务层处理
 * @author sean
 * @email 2074844820@qq.com
 * @date 2023-09-11
 */
@Service
@Transactional(readOnly = true)
public class OrderImageServiceImpl extends BaseServiceImpl<OrderImageMapper, OrderImage> implements OrderImageService
{
    private static final Logger log = LoggerFactory.getLogger(OrderImageServiceImpl.class);

    /**
     * 获取单条数据
     * @param orderImage 订单详情照片
     * @return 订单详情照片
     */
    @Override
    public OrderImage get(OrderImage orderImage)
    {
        OrderImage dto = super.get(orderImage);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 订单详情照片id
     * @return 订单详情照片
     */
    @Override
    public OrderImage get(String id)
    {
        OrderImage dto = super.get(id);
        return dto;
    }


    /**
     * 查询订单详情照片列表
     * @param orderImage 订单详情照片
     * @return 订单详情照片
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public List<OrderImage> findList(OrderImage orderImage)
    {
        return super.findList(orderImage);
    }

    /**
     * 分页查询订单详情照片列表
     * @param orderImage 订单详情照片
     * @return 订单详情照片
     */
    @Override
    @DataScope(userAlias = "a",deptAlias = "a")
    public PageInfo<OrderImage> findPage(OrderImage orderImage)
    {
        return super.findPage(orderImage);
    }

    /**
     * 保存订单详情照片
     * @param orderImage
     * @return 结果
     */
    @Override
    public boolean save(OrderImage orderImage)
    {
        return super.save(orderImage);
    }


    /**
     * 删除订单详情照片信息
     * @param orderImage
     * @return 结果
     */
    @Override
    public boolean remove(OrderImage orderImage)
    {
        return super.remove(orderImage);
    }

    /**
     * 批量删除订单详情照片
     * @param ids 需要删除的订单详情照片ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteOrderImageByIds(String[] ids)
    {
        return mapper.deleteOrderImageByIds(ids);
    }

    /**
     * 获取最大编号
     * @param orderImage 订单详情照片
     * @return 结果
     */
    @Override
    public int findMaxSort(OrderImage orderImage)
    {
        return NumberUtils.nextOrder(mapper.findMaxSort(orderImage));
    }

    @Override
    @Transactional(readOnly = false)
    public Integer batchInsert(List<OrderImage> orderImageList) {
        return mapper.batchInsert(orderImageList);
    }
}
